#!/bin/bash
#This script is set MySQL password for the frist time!
mysqlinitpasswd=`grep 'temporary password' {{ MYSQL_HOME }}/mysql/mysql.log |awk '{print $11}'`
mysql -uroot -p${mysqlinitpasswd} -S /tmp/mysql.sock -e "set password = password('{{ MYSQL_PASSWD }}');grant all privileges on *.* to 'root' @'%' identified by '{{ MYSQL_PASSWD }}';flush privileges;" --connect-expired-password
